#pragma once
#include "../lib3dw/Scene.h"
#include "../lib3dw/PickRay.h"
#include "../lib3dw/Camera.h"
#include "../lib3dw/Timer.h"
#include "../lib3dw/PointLightSource.h"
#include "../lib3dw/ConfigSingleton.h"
#include "Board.h"
#include "Game.h"
#include "StatusBar.h"
#include "Duck.h"
#define ESC 27
#define SPACE 32

namespace Dicewars
{
	using namespace lib3dw;

	class Program
	{
		public:
			Program();
			~Program();
			void ResizeWindow(int x, int y);
			void HandleKeyReleases(unsigned char key, int x, int y);
			void HandleKeyPresses(unsigned char key, int x, int y);
			void HandleSpecialKeyPresses(int key, int x, int y);
			void HandleMouseClicks(int button, int state, int x, int y);
			void HandlePassiveMouseMotion(int x, int y);
			void HandleActiveMouseMotion(int x, int y);
			void Render();
			void UpdateGameState();
			void Init();
			
		private:
			Scene* scene;
			PickRay* pickRay;
			StatusBar* status;
			PointLightSource* lightZero;
			SpotLightSource* lightOne;
			Camera* camera;
			Game* game;
			Board* board;
			Timer* timer;
			Player* playerZero;
			Player* playerOne;
			Player* playerTwo;
			Player* playerThree;
			double secondsPassed;
			int	framesPainted;
			int mouseButton;
			int lastMouseX;
			int lastMouseY;
			int modifierKey;
			bool showFPS;
			bool shaders;
			bool isButtonDown;
			bool rotateLeft;
			bool rotateRight;
			bool rotateUp;
			bool rotateDown;
			bool zoomIn;
			bool zoomOut;
			BoardTile* currentTile;
			BoardTile* previousTile;
	};
}